<template>
  <el-dialog :title="title" :visible.sync="visible" width="1200px" append-to-body>
    <el-form ref="form" inline :model="form" label-width="170px">
      <!--  基础信息    -->
      <el-form-item label="门市部名称" prop="storeName">
        <el-input
          v-model="form.storeName"
          placeholder="门市部名称"
          readonly
          style="width: 240px"
        />
      </el-form-item>

      <div class="titleDiv">联系人信息</div>
      <el-divider/>
      <div class="gx-page-fix-pad"></div>
      <el-table
        :data="form.contractList"
        style="width: 100%">
        <el-table-column prop="headName" label="负责人" width="180">
        </el-table-column>
        <el-table-column prop="contractStr" label="联系地址" width="180">
        </el-table-column>
        <el-table-column prop="telNumber" label="联系电话">
        </el-table-column>
        <el-table-column prop="weChat" label="微信号">
        </el-table-column>
        <el-table-column prop="qqStr" label="QQ">
        </el-table-column>
      </el-table>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="cancel">取 消</el-button>
    </div>
  </el-dialog>
</template>

<script>
import {getById} from "@/api/system/store";

export default {
  name: "create",
  data() {
    return {
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      visible: false,
      // 表单参数
      form: {
        "id":'',
        "storeName": "",
        "contractList": [
          {
            headName:'',
            contractStr:'',
            telNumber:'',
            weChat:'',
            qqStr:'',
          }
        ]
      },
    }
  },
  methods: {
    open(id) {
      if (id) {
        getById(id).then(response => {
          this.visible = true
          this.$nextTick(() => {
            this.form = response.data
          })
          this.title = "门市详情"
        })
      }
    },
    // 取消按钮
    cancel() {
      this.visible = false
    },
  }
}
</script>
<style lang="scss" scoped>
.titleDiv{
  color: #1E5494;
  margin-left: 30px;
}
</style>
